package binarytree

import "fmt"

// PreOrder Travers the tree in the following order root --> left --> right
func PreOrder(tree *TreeNode) {
	if tree == nil {
		return
	}
	// print root node
	fmt.Print(tree.Data, " ")
	// print left node
	PreOrder(tree.Left)
	// print right node
	PreOrder(tree.Right)
}
